Skip to content

Conversation

@brymut
Copy link
Contributor

@brymut brymut commented Nov 10, 2025

/claim #35898
Resolves #35898

Summary of key changes:

  1. Add file name search/Go to file functionality to repo button row.
  2. Add backend functionality to delete directory
  3. Add context menu for directories with functionality to copy path & delete a directory
  4. Move Add/Upload file dropdown to right for parity with Github UI
  5. Add tree view to the edit/upload UI

Detailed breakdown:

1. Add search functionality to tree view

Added file search to repo view using existing searchfilterRepoFilesWeighted, with new modal to display the search results. User can navigate through search results using keyboard to scroll, select and escape the search on top of using mouse. No matches found notice when no results are found. Replacing the existing FindFiles page.

Screen.Recording.2025-11-30.at.05.37.00.mov

2. Add backend functionality to delete directory

Modified the DeleteFilePost endpoint and related services to also allow for deletion of whole directories to support the "Delete directory" menu option added to the context menu.

3. Add context menu for directories with functionality to copy permalink & delete a directory

Added context menu for "Copy Permalink" & "Delete directory" supported by backend change listed above.

Screen.Recording.2025-11-30.at.05.40.19.mov

4. Move Add/Upload file dropdown to right for parity with Github UI

Minor change to move this option to the right since already existed.

Screenshot 2025-11-30 at 05 44 29

5. Add tree view to the edit/upload & patch UI

Screenshot 2025-11-30 at 05 50 08

@GiteaBot GiteaBot added the lgtm/need 2 This PR needs two approvals by maintainers to be considered for merging. label Nov 10, 2025
@github-actions github-actions bot added modifies/templates This PR modifies the template files modifies/frontend labels Nov 10, 2025
@brymut brymut changed the title Add Search, Add/Upload File, delete directory & "copy path" functionality to the repo's tree view UI Add Search, move Add/Upload File, delete directory & "copy path" functionality to the repo's tree view UI Nov 10, 2025
@brymut brymut force-pushed the feat-enhance-tree-view branch from 3452673 to 1cf0812 Compare November 10, 2025 09:58
@brymut brymut force-pushed the feat-enhance-tree-view branch 3 times, most recently from ca8791e to 457f17f Compare November 11, 2025 03:59
@github-actions github-actions bot added the modifies/go Pull requests that update Go code label Nov 11, 2025
@brymut brymut force-pushed the feat-enhance-tree-view branch 3 times, most recently from f169aa3 to 809a645 Compare November 11, 2025 07:15
@brymut brymut marked this pull request as ready for review November 11, 2025 07:20
@lunny
Copy link
Member

lunny commented Nov 11, 2025

  1. When creating a new file, it currently redirects to the classic “new file” page. Instead, it should open an inline editor similar to GitHub’s implementation, keeping the left tree view visible. The same behavior should apply to Upload Files and Apply Patch actions.
  2. There is no way to add a new file for the root directory in the tree view UI.

@lunny lunny added this to the 1.26.0 milestone Nov 11, 2025
@brymut
Copy link
Contributor Author

brymut commented Nov 12, 2025

2. There is no way to add a new file for the root directory in the tree view UI.

You can do so in the main repo page in the code tab, same as to how its done on Github. Since I'm not aware of a way to view the root directory except for in the main repo page on the code tab (same on Github). Or perhaps I'm not understanding what you mean.

@brymut brymut force-pushed the feat-enhance-tree-view branch from 809a645 to 0adcc74 Compare November 12, 2025 10:10
@brymut
Copy link
Contributor Author

brymut commented Nov 12, 2025

  1. When creating a new file, it currently redirects to the classic “new file” page. Instead, it should open an inline editor similar to GitHub’s implementation, keeping the left tree view visible. The same behavior should apply to Upload Files and Apply Patch actions.

Added
Screenshot 2025-11-12 at 13 07 08

@lunny
Copy link
Member

lunny commented Nov 12, 2025

  • It seems there is a bug that the icon to show/hide tree view will always be hidden.
image
  • And maybe the commit box should be move to up right corner like what github did after the tree view introduced to the editor page.

@brymut brymut force-pushed the feat-enhance-tree-view branch 6 times, most recently from 4540d07 to 57782c3 Compare November 13, 2025 11:04
@brymut
Copy link
Contributor Author

brymut commented Nov 13, 2025

  • It seems there is a bug that the icon to show/hide tree view will always be hidden.

Fixed

  • And maybe the commit box should be move to up right corner like what github did after the tree view introduced to the editor page.

Moved. Should be more like Github's UX now:

Screen.Recording.2025-11-13.at.14.04.46.mov

@lunny
Copy link
Member

lunny commented Nov 13, 2025

Great work!

  • It seems the Delete File UI needs some improvements? The close button in the top-right corner doesn’t seem to work either. Perhaps converting this into a popup dialog would provide a better experience than open in a new page.

  • The Apply Patch UI seems to need some improvements. There are two “Cancel” buttons and the repository name appears twice. I don’t think this issue is caused by this PR, but since it’s related, it would be better to address them together.

image
  • Creating a new file under the root folder is inconvenient because I have to return to the repository’s home page each time. I understand this behavior is inherited from GitHub, but it doesn’t seem like the best design. Could you also add buttons for Create File / Upload File / Apply Patch directly in the file view, so that new items can be created under the same folder as the currently viewed file?

@brymut
Copy link
Contributor Author

brymut commented Nov 29, 2025

Thanks for addressing the issues you brought up. Looks like you've beat me to most of it. 😅

@wxiaoguang
Copy link
Contributor

Fixed more problems:

  1. fix popup position (it's better to use absolute but not fixed)
  2. fix key up/down navigation (it shouldn't use nextTick, otherwise the UI becomes very laggy)
  3. add a loading indicator
  4. remove most !el check, it's easier to maintain the always-existing elements
  5. remove the inline visibility style

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Nov 29, 2025

Found new problems, for example, if you navigate the tree item from the "editor" page, then some styles become wrong.

And the "go to file" input won't appear.

Need to carefully check every change, but not just copy the "repo-view-container" code to other pages and assume that everything should work.

image

@wxiaoguang
Copy link
Contributor

Done from my side. Please help to test and review, feel free to merge if no more problem.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Nov 29, 2025

Remove redundant repo name from Apply Patch breadcrumb UI

By the way, I reverted this change. IMO:

  • This page is seldom used, and it's not path-related IIRC, so no need to add the tree view
  • Other pages (including edit, upload, etc) all have the "duplicate" repo name, so removing it or not, doesn't need to be in this PR's scope.

@wxiaoguang wxiaoguang changed the title Add Search, move Add/Upload File, delete directory & "copy path" functionality to the repo's tree view UI Add "Go to file", "Delete Directory" to repo file list page Nov 29, 2025
@brymut
Copy link
Contributor Author

brymut commented Nov 30, 2025

Gone over the changes, retested all the functionality and updated the PR description to reflect recent changes. LGTM @wxiaoguang, thanks for having a look.

@brymut
Copy link
Contributor Author

brymut commented Nov 30, 2025

Is it possible to add an approval to this now? @wxiaoguang

Copy link
Contributor

@wxiaoguang wxiaoguang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

BTW: found a new bug: the blame page doesn't work with the "upload file" because some data is missing. Did a quick fix and leave some TODO comments.

@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Nov 30, 2025
@delvh delvh added the type/feature Completely new functionality. Can only be merged if feature freeze is not active. label Nov 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🙋 Bounty claim lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. modifies/api This PR adds API routes or modifies them modifies/frontend modifies/go Pull requests that update Go code modifies/templates This PR modifies the template files modifies/translation type/feature Completely new functionality. Can only be merged if feature freeze is not active.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feat Request: Add Search, move Add/Upload File, delete directory & "copy path" functionality to the repo's tree view UI

6 participants